home *** CD-ROM | disk | FTP | other *** search
/ Ian & Stuart's Australian Mac 1 / Ian and Stuart's One (Australia).iso / Australasian Legends / Commercial / Rainbow Hill / MacDOS™ 2.0.0 / User's Guide / 02 The Environment < prev    next >
Text File  |  1994-09-20  |  20KB  |  404 lines

  1. 2  The Environment
  2.        The  Macintosh  Finder allows you to  perform  a  series  of
  3.        operations  by clicking and dragging icons and windows  with
  4.        your  mouse,  while MacDOS expects you to type  commands  on
  5.        the keyboard.
  6.  
  7.        MacDOS  does not normally display a cursor changing  from  a
  8.        clock  to  an arrow to tell you when an operation  has  been
  9.        completed. Instead, whenever MacDOS completes the  execution
  10.        of  a  command  and  is ready to accept  the  next  one,  it
  11.        displays  a prompting string at the beginning of the  bottom
  12.        line  of the screen. That line is called Command Line.  With
  13.        commands  affecting  several files and folders  at  a  time,
  14.        MacDOS  also displays the name of each item before it begins
  15.        operating on it.
  16.  
  17.        A  command  is  like  an order in English:  a  verb  in  the
  18.        imperative  form, possibly followed by one or  more  objects
  19.        and some qualifiers. Commands are usually case insensitive.
  20.  
  21.        The  verb  is  called Command Name, the objects  Parameters,
  22.        and the qualifiers Switches  or Options.
  23.  
  24.        After  completing  the  typing of the  command,  you  direct
  25.        MacDOS to start its execution by pressing the RETURN key.
  26.  
  27. Command Name
  28.  
  29.        The  command name must be the first word of the command  and
  30.        is  never  case sensitive. Also, command names  provided  by
  31.        MacDOS never contain spaces or other special characters.
  32.  
  33. Parameters
  34.        Most  commands need one or more parameters to  identify  the
  35.        objects  they  are requested to operate on.  An  example  of
  36.        commands which do not require any additional information  is
  37.        CLS, used to clear the MacDOS window.
  38.  
  39.        Many  commands  accept different numbers of  parameters  and
  40.        automatically "fill in" the missing parameters with  default
  41.        values.  For  example,  the command DIR  displays  lists  of
  42.        files  in the MacDOS window and expects one parameter  which
  43.        identifies  the  files to be listed. Nevertheless,  you  can
  44.        just  type  DIR without parameters to list the  contents  of
  45.        the current folder.
  46.  
  47.        Parameters  are sometimes case sensitive. For example,  when
  48.        you  rename a file you have to type the new name exactly  as
  49.        you want it, with upper and lower case characters.
  50.  
  51.        The   order  of  parameters  is  almost  always  fixed.  For
  52.        example, if you want to rename a file, you have to type  the
  53.        old  name first and the new name second. A case in which the
  54.        order  is not important is when you copy several files  with
  55.        a  single COPY command. In that case, you type the filenames
  56.        one  after the other separated by commata. MacDOS will  copy
  57.        the  files in the order in which you specify them, but  this
  58.        should usually have no practical consequences.
  59.  
  60. Switches
  61.        Switches  always  start with a slash  (the  character  '/').
  62.        This  is how MacDOS distinguishes them from parameters.  The
  63.        slash  is  always  followed by a character which  identifies
  64.        the  particular switch, and possibly other characters  which
  65.        select  different ways of operation. For example, you obtain
  66.        a  sorted  list  of  files by adding the switch  /O  to  the
  67.        command DIR. You can also specify ways of sorting by  adding
  68.        other  characters to the switch: DIR/ODS displays a list  of
  69.        files  sorted  on  the basis of their last upDate  and  Size
  70.        (update  first),  while DIR/OSD lists  the  same  files  but
  71.        giving priority to their size rather than the date and  time
  72.        of last update.
  73.  
  74.        As  switches  are always used to request optional  features,
  75.        they  are never mandatory. Nevertheless, very often you will
  76.        need  to  use  one or more switches. For example,  to  avoid
  77.        that  a  long list of files disappears off the  top  of  the
  78.        MacDOS window, you can type DIR/P instead of simply DIR.
  79.  
  80.        As  with parameters, switches are seldom case sensitive. One
  81.        case  sensitive  switch is /T, used to select  a  file-type.
  82.        The  'T'  of the switch can be in lower or upper  case,  but
  83.        the  file  type  must be correct: /t=TEXT is different  from
  84.        /t=TeXT because the two types 'TEXT' and 'TeXT' are seen  as
  85.        different by the Mac Operating System.
  86.  
  87.        The  order and position of switches within a command are  in
  88.        most   cases  irrelevant.  In  fact,  MacDOS  extracts   and
  89.        analyses all the switches before looking at the parameters.
  90.  
  91.        One  switch  accepted by all commands is /?. When  you  type
  92.        this  switch  in  any  position, MacDOS  ignores  all  other
  93.        parameters and switches and displays a brief description  of
  94.        the command.
  95.  
  96. Redirection and Piping
  97.        Most  commands produce some output messages, either  because
  98.        that  is  their purpose, or because they provide information
  99.        on  their progress. For example, the purpose of the  command
  100.        DIR  is  precisely  to produce a list of filenames.  On  the
  101.        other  hand, the COPY command lists the names of  the  files
  102.        being copied.
  103.  
  104.        By  default,  MacDOS displays these messages in  the  MacDOS
  105.        window but you can decide to re-direct them to a text  file.
  106.        To  do  so,  you  must add to the command a  "greater  than"
  107.        character  followed  by  the name  of  the  text  file.  For
  108.        example,  DIR>MyFile  lists  the  contents  of  the  current
  109.        folder in the text file MyFile rather than on the screen.
  110.  
  111.        When  you  redirect the output, MacDOS produces files  which
  112.        can  be  directly  opened  with  any  text  editor  or  word
  113.        processor.
  114.  
  115.        Note  that  error and warning messages are never  redirected
  116.        to  files. MacDOS always displays them on the screen.  Also,
  117.        if  you  attempt  to redirect the output of  commands  which
  118.        have   nothing  to  redirect,  MacDOS  displays  a   warning
  119.        message,  ignores the redirection, and executes the  command
  120.        as if you had not attempted a redirection.
  121.  
  122.        You  can append the output of a command to an existing file,
  123.        rather  than create a new one, by typing two "greater  than"
  124.        signs instead of one (eg. DIR>>MyFile).
  125.  
  126.        The commands which accept output redirection are:
  127.          ALARM,  CALL, CD, CHDIR, CLOSE, CONFIRM, COPY, DATE,  DIR,
  128.        EJECT,  EXIT,  HELP,  LOG,  MD,  MKDIR,  MEM,  MORE,   NEXT,
  129.        ONERROR,  OPEN,  PATH, PRINT, PROMPT, READ,  RD,  REM,  REN,
  130.        RENAME,  RESTART,  RMDIR, SERIAL, SHOW, SHUTDOWN,  SUBSTVOL,
  131.        TIME, TREE, TYPE, VER, VERIFY, VOL, WRITE, XCOPY .
  132.  
  133.        Some  of  these commands do not actually produce any output.
  134.        Therefore, their acceptance of output redirection is  simply
  135.        an  indication  that they will not report a warning  message
  136.        if you do attempt to redirect their output.
  137.  
  138.        Beside  redirecting the output produced by  a  command,  you
  139.        can  also  redirect the input from which  the  command  MORE
  140.        accepts  data. You do this by appending to the command  line
  141.        a  "less  than" character followed by the name of  the  text
  142.        file  containing the data. This is useful in order to  break
  143.        down  long  displays  into pages. For  example,  MORE<MyFile
  144.        displays  the  text  file MyFile one  page  at  a  time  and
  145.        prompts you to continue or interrupt the display at the  end
  146.        of each page.
  147.  
  148.        Input  redirection  is also possible with MacDOS  extensions
  149.        (ie.  MacDOS  filter  applications).  Please  refer  to  the
  150.        appropriate section for the details.
  151.  
  152.        Instead  of redirecting the output of a command  to  a  file
  153.        and  then  use  that file as input to MORE or  to  a  filter
  154.        application,  you can combine the two commands  and  achieve
  155.        the  same result in a more efficient way. This mechanism  is
  156.        called piping. You just need to type the commands one  after
  157.        the  other  separated by a vertical bar (the character  '|',
  158.        called pipe). For example, if the on-line help displayed  by
  159.        the  command  COPY/?  is too long to  be  contained  in  the
  160.        MacDOS  window,  you can type  COPY/?|MORE and  MacDOS  will
  161.        wait for you at the end of each page.
  162.  
  163.        Pipes are only relevant for:
  164.        •  Internal commands which allow output redirection.
  165.        •  The  command  MORE (ie. the only internal  command  which
  166.           accepts input redirection).
  167.        •  MacDOS filter applications.
  168.  
  169.        The  command  FOR is a special case, because it  passes  its
  170.        output  or  input redirection to the command  which  follows
  171.        the  DO  keyword.  Therefore, although FOR itself  does  not
  172.        accept  redirection, a command line beginning with  FOR  can
  173.        contain  I/O redirection. Only single-line FORs  accept  I/O
  174.        redirection. Moreover, input redirection and piping is  only
  175.        possible in conjuction with MORE .
  176.  
  177.        What  follows  is a complete list of the rules  that  govern
  178.        redirection and piping in the MacDOS environment.  In  order
  179.        to  fully understand all its details, you will probably need
  180.        to  come back to this list after reading some other sections
  181.        of this User's Guide.
  182.        •  In  a  single  command, you can only redirect  input  and
  183.           output  once, and their order is irrelevant. If the  line
  184.           includes  pipes,  the input redirection  applies  to  the
  185.           first  command  and the output redirection  to  the  last
  186.           one,   regardless  of  where  the  redirections  actually
  187.           appear within the line.
  188.        •  MacDOS  displays  a  warning message  whenever  the  user
  189.           applies  input  or output redirection to a  command  that
  190.           does not support it.
  191.        •  Most  internal  commands  accept  output  redirection  to
  192.           file,  but  only MORE accepts input redirection.  Single-
  193.           line  FORs  accept  input redirection when  their  DO  is
  194.           followed  by  MORE,  in  which case  the  redirection  is
  195.           considered  to  be referring to the MORE rather  than  to
  196.           the   FOR   itself.   Single-line  FORs   accept   output
  197.           redirection, but multi-line FORs don't.
  198.        •  Batch programs accept output redirection to file but  not
  199.           input redirection.
  200.        •  Applications  and  AppleScripts do  not  accept  any  I/O
  201.           redirection.
  202.        •  MacDOS   extensions   accept  both   input   and   output
  203.           redirections.  Therefore, a chain of filters  can  obtain
  204.           its input from a disk file rather than from a command.
  205.        •  MORE  can only appear at the end of a command line  (this
  206.           includes  the  case in which there is  nothing  else  and
  207.           MORE is on its own).
  208.        •  A  command line containing pipes can only begin  with  an
  209.           internal  command which supports output redirection  (but
  210.           excluding  MORE), or with a filter. If it begins  with  a
  211.           filter, the command line must include input redirection.
  212.        •  The  command  FOR only supports a pipe in  the  following
  213.           case:
  214.  
  215.          FOR  %var  [/L]  IN  (set)  DO internal-com-with-params  |
  216.           MORE
  217.  
  218.          That  is,  in  the single-line format and  with  a  single
  219.           pipe used for MORE.
  220.  
  221. Errors and Warnings
  222.        MacDOS distinguishes between serious conditions which  cause
  223.        a  command  to  be rejected or aborted (errors)  and  others
  224.        which should not occur but can be tolerated (warnings).
  225.  
  226.        In  any  case, MacDOS displays a message to inform you  that
  227.        an abnormal condition has been detected.
  228.  
  229.        Most  errors are due to the presence in a command of invalid
  230.        parameters  and  switches,  or the  request  to  operate  on
  231.        something that does not exist.
  232.  
  233.        Warnings  are  usually caused by the attempt of  redirecting
  234.        I/O  of  a  command which does not support redirection.  You
  235.        also  get  a  warning when you attempt to use a  DOS  switch
  236.        which is not supported by MacDOS.
  237.  
  238.        MacDOS normally reports errors and warnings by displaying  a
  239.        short message. You can use the ALARM ON command to have  all
  240.        error  and  warning conditions reported via an alert  dialog
  241.        box.  MacDOS  then pauses whenever it detects a problem  and
  242.        provides  in  the alert box some information  which  is  not
  243.        normally displayed.
  244.  
  245.        Refer  to  Appendix  A  for an indication  of  the  possible
  246.        causes  of  error and warning messages and  some  advice  on
  247.        possible remedies.
  248.  
  249. Menus and Window
  250.        The  MacDOS window accepts commands and provides  space  for
  251.        displaying  command  outputs. This is  why  throughout  this
  252.        manual  it  is also referred to as the console  window.  You
  253.        can  change the character size of the console window through
  254.        the system variable FONTSIZE.
  255.  
  256.        MacDOS  supports the standard mouse operations to work  with
  257.        text: cut, copy, paste, and clear. You can select text  with
  258.        the  mouse and then select the appropriate item of the  Edit
  259.        menu  or type the keyboard shortcut to perform the operation
  260.        you need.
  261.  
  262.        This  frees  you  from having to type long file  and  folder
  263.        names,  as  you  can  copy names from a directory  list  and
  264.        paste  them into the command line. To make such an operation
  265.        easier,   MacDOS  selects  a  whole  quoted  string   (quote
  266.        characters  included) when you double click between  a  pair
  267.        of matching quotes.
  268.  
  269.        Note  that you cannot paste carriage return characters  into
  270.        the  command  line,  because MacDOS  interprets  a  carriage
  271.        return as an order to execute a command.
  272.  
  273.        Typed  characters are only accepted within the command line.
  274.        If  the selection is entirely outside the command line,  the
  275.        insertion  point  is moved to the end of  the  command  line
  276.        before  showing the character typed. If, on the other  hand,
  277.        a  selection  covers  part of a command,  the  selection  is
  278.        reduced  to that part before replacing it with the character
  279.        typed  (ie. the left edge of the selection is moved  to  the
  280.        first character of the command line).
  281.  
  282.        Only the command line can be altered. Therefore, outside  of
  283.        the command line:
  284.        •  "Cut Text" behaves like "Copy Text".
  285.        •  "Paste  Text" moves to the end of the command line before
  286.           pasting,  effectively  attaching  the  content   of   the
  287.           clipboard to the end of the command.
  288.        •  "Clear Text" has no effect.
  289.        If  the selection includes a part of the command line, "Copy
  290.        Text",  "Paste  Text", and "Clear Text"  behave  as  if  the
  291.        selection  only consisted of the part which  is  within  the
  292.        command  line. That is, only the part of selection which  is
  293.        within the command line is cut, replaced, or cleared.
  294.  
  295.        Up   and  down  arrows  scroll  through  the  previous   and
  296.        following   commands.   This  possibility  is   particularly
  297.        useful  when  you  mistype a character of  a  long  command,
  298.        because  you can "recall" the command by typing an up-arrow.
  299.        You  can  then  correct  the mistake instead  of  having  to
  300.        retype the whole lot.
  301.  
  302.        Left  and  right  arrows  extend selections  when  they  are
  303.        shifted  and  move  to the beginning  and  the  end  of  the
  304.        command line when they are pressed together with the  option
  305.        key.
  306.  
  307.        MacDOS  also responds to the "Select cmd line" item  of  the
  308.        Edit  menu by highlighting and selecting whatever  you  have
  309.        already  typed after the current prompt. Similarly,  "Select
  310.        All" highlights the contents of the whole console window.
  311.  
  312.        The  two  items "Previous Cmd" and "Next Cmd"  of  the  Edit
  313.        menu  (and their corresponding shortcuts cmd-dash  and  cmd-
  314.        equal) behave like the up and down arrows.
  315.  
  316.        The  console window accepts vertical scrolling and  resizing
  317.        via  the standard vertical sidebar and boxes. The buffer  is
  318.        guaranteed  to  store  at least the  last  24000  characters
  319.        typed or displayed.
  320.  
  321.        You  can  clear  the  console window with  the  command  CLS
  322.        (which stands for CLear Screen).
  323.  
  324.        To  print  the  contents of the console window,  select  the
  325.        "Print console..." item of the File menu or simply type  the
  326.        command  PRINT . You can also set the format of the  printed
  327.        page  by  clicking on the item "Page Setup..." of  the  File
  328.        menu.
  329.  
  330.        To close the console window and terminate MacDOS, you can:
  331.        •  Click on the "go away" box in the top left corner of  the
  332.           window.
  333.        •  Select either the Close or Quit item of the File menu.
  334.        •  Type cmd-Q.
  335.        •  Type the command EXIT .
  336.  
  337.        If  you do not remember how to display MacDOS on-line  help,
  338.        select  the "Help..." item of the apple menu. It  will  tell
  339.        you how to use the command HELP .
  340.  
  341.        If  some colleagues or friends would like to try MacDOS, you
  342.        can  create a demo version of MacDOS by selecting the  "Make
  343.        DEMO..."  item of the File menu. MacDOS will then  duplicate
  344.        the  MacDOS  application  file and disable  the  appropriate
  345.        functionality.
  346.  
  347. Control Codes
  348.        You can abort the execution of most commands by typing cntl-
  349.        C  or  cmd-dot.  MacDOS  achieves  this  by  monitoring  the
  350.        keyboard  at  times when the current command can  be  safely
  351.        interrupted.
  352.  
  353.        Two additional control codes are available: cntl-S and cntl-
  354.        Q.  They  pause  and  resume long listings  on  the  monitor
  355.        screen.  For example, instead of using the command  MORE  to
  356.        list  a  text file one page at a time, you might  choose  to
  357.        use  the  command  TYPE  and  press  cntl-S  when  you  spot
  358.        something  which you want to read. You can then type  cntl-Q
  359.        to resume the listing or cntl-C to abort it.
  360.  
  361. Tabbing
  362.        You  can use the TAB key to speed up the typing of long file
  363.        and  folder names and the shift-TAB key combination to enter
  364.        frequently used strings.
  365.  
  366.    TAB
  367.        When  you press the TAB key, MacDOS interprets the preceding
  368.        characters  as  a  part of a file or folder  name  (with  or
  369.        without  path)  and attempts to complete  it.  To  determine
  370.        what  portion  of  the command line to use, MacDOS  examines
  371.        the  preceding characters in reversed order and  stops  when
  372.        it finds a quote or a space.
  373.  
  374.        It  then scans the current folder looking for matching names
  375.        of files or subfolders:
  376.        •  If  MacDOS  does  not find any match, it  redisplays  the
  377.           command unchanged.
  378.        •  If  MacDOS  finds a single match, it completes  the  name
  379.           within the command line and redisplays the command.
  380.        •  If  MacDOS  finds several matches, it lists  them  before
  381.           redisplaying  the command unchanged. In any case,  MacDOS
  382.           truncates  the list of matches if it occupies  more  than
  383.           half  of  the  console  window. If the  matches  have  in
  384.           common  more  characters than those typed  by  the  user,
  385.           MacDOS  extends the partial name before redisplaying  the
  386.           command.  This  mechanism  is  particularly  useful  when
  387.           navigating  hierarchies of folders, because it  lets  you
  388.           type  the minimum number of characters needed to identify
  389.           any particular item.
  390.  
  391.        Whenever  MacDOS completes or extends a name and finds  that
  392.        the  name  was  not  quoted, it inserts the   opening  quote
  393.        character.
  394.  
  395.    Shift-TAB
  396.        When  you  type  TAB  while pressing the SHIFT  key,  MacDOS
  397.        interprets   the  preceding  characters  as   part   of   an
  398.        abbreviation and attempts to replace it with a full string.
  399.  
  400.        For  a  description  of this feature, please  refer  to  the
  401.        "Abbreviations"  subsection  of  the  "Customising   MacDOS"
  402.        section.
  403.  
  404.